package db

import (
	"encoding/json"
)

const (
	Running Status = iota + 1
	Offline
	Except
)

type Status int

func (s Status) MarshalJSON() ([]byte, error) {
	return json.Marshal(s.String())
}

func (s Status) String() string {
	switch s {
	case Running:
		return "Running"
	case Offline:
		return "Offline"
	case Except:
		return "Except"
	default:
		return ""
	}
}
